﻿@model WebApplication11.Models.Books

@{
    ViewBag.Title = "Create A Book";
}

<h2>CreateBook</h2>
<div class="container-well">
    @Html.ValidationSummary("", new { style = "color:red;" })
    <form method="post">
        @Html.AntiForgeryToken()
        @if (ViewBag.ISBNError != null)
        {
            <span style="color: darkred">@ViewBag.ISBNError</span><br />
        }
        @Html.LabelFor(x => x.Id)
        @Html.TextBoxFor(x => x.Id, new { @class = "form-control" })
        <br />
        @Html.LabelFor(x => x.Title)
        @Html.TextBoxFor(x => x.Title, new { @class = "form-control" })
        @Html.ValidationMessageFor(x => x.Title, "", new { style = "color: red;" })
        <br />
        <br />
        @Html.LabelFor(x => x.Author)
        @Html.TextBoxFor(x => x.Author, new { @class = "form-control" })
        <br />
        @Html.LabelFor(x => x.Genre)
        @Html.TextBoxFor(x => x.Genre, new { @class = "form-control" })
        <br />
        @Html.LabelFor(x => x.PubDate)
        @Html.TextBoxFor(x => x.PubDate, new { @class = "form-control" })
        <br />
        @Html.LabelFor(x => x.Summary)
        @Html.TextAreaFor(x => x.Summary, new { @class = "form-control" })

        <br />
        @Html.LabelFor(x => x.Rating)
        <select class="form-control" name="Rating">
            <option value="1" selected>1 Star</option>
            @for (var i = 2; i < 6; i++)
            {
                <option value="@i">@i Stars</option>
            }
        </select>

        <br />
        @Html.LabelFor(x => x.ImgUrl)
        @Html.TextBoxFor(x => x.ImgUrl, new { @class = "form-control" })
        <br />
        <button class="btn btn-success">Submit</button>
    </form>
</div>